﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TestRTE._Default" %>

<%@ Register Assembly="Invoteco.Web.RichTextEditor" Namespace="Invoteco.Web.RichTextEditor" TagPrefix="Invoteco" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css">
     .activetab{width:20%; border-left: solid 1px black; border-top:solid 1px black; border-right:solid 1px black; border-bottom: none 1px black;}
     .inactivetab{width:20%; border-left: none 1px black; border-top:none 1px black; border-right:none 1px black; border-bottom: solid 1px black;}
</style>
    <title>InvotecoRTE</title>
    <script type="text/javascript">
        //ЭТО ПЕРЕРАБОТАННЫЙ ИСХОДНЫЙ СКРИПТ ДЛЯ ПРОСТЕЙШЕГО WYSIWYG. Служит для обеспечения работоспособности
       //HTML-шаблона
        function templateScript() {
            var newHTML = "<iframe scrolling='no' frameborder='no' src='#' id='tframeId' name='tframeId'width='100%' height='100%'></iframe><br/>";
            document.getElementById('framecell').innerHTML = newHTML;
            var isGecko = navigator.userAgent.toLowerCase().indexOf("gecko") != -1;
            var tiframe = (isGecko) ? document.getElementById("tframeId") : frames["tframeId"];
            var tiWin = (isGecko) ? tiframe.contentWindow : tiframe.window;
            var tiDoc = (isGecko) ? tiframe.contentDocument : tiframe.document;
            // Иначе не работает в Mozilla
            tiDoc.open(); tiDoc.write(); tiDoc.close();
            if (!tiDoc.designMode) alert("Визуальный режим редактирования не поддерживается Вашим браузером");
            else tiDoc.designMode = (isGecko) ? "on" : "On";
            tiWin.focus();
        } 
  
        function template_setBold() {
            var isGecko = navigator.userAgent.toLowerCase().indexOf("gecko") != -1;
            var tiframe = (isGecko) ? document.getElementById("tframeId") : frames["tframeId"];
            var tiWin = (isGecko) ? tiframe.contentWindow : tiframe.window;
            var tiDoc = (isGecko) ? tiframe.contentDocument : tiframe.document;
            if (!tiDoc.designMode) alert("Визуальный режим редактирования не поддерживается Вашим браузером");
            else tiDoc.designMode = (isGecko) ? "on" : "On";
            tiWin.focus();
            tiWin.document.execCommand("bold", null, "");
        }
        function template_setItal() {
            var isGecko = navigator.userAgent.toLowerCase().indexOf("gecko") != -1;
            var tiframe = (isGecko) ? document.getElementById("tframeId") : frames["tframeId"];
            var tiWin = (isGecko) ? tiframe.contentWindow : tiframe.window;
            var tiDoc = (isGecko) ? tiframe.contentDocument : tiframe.document;
            if (!tiDoc.designMode) alert("Визуальный режим редактирования не поддерживается Вашим браузером");
            else tiDoc.designMode = (isGecko) ? "on" : "On";
            tiWin.focus();
            tiWin.document.execCommand("italic", null, "");
        }
        function template_setUnder() {
            var isGecko = navigator.userAgent.toLowerCase().indexOf("gecko") != -1;
            var tiframe = (isGecko) ? document.getElementById("tframeId") : frames["tframeId"];
            var tiWin = (isGecko) ? tiframe.contentWindow : tiframe.window;
            var tiDoc = (isGecko) ? tiframe.contentDocument : tiframe.document;
            if (!tiDoc.designMode) alert("Визуальный режим редактирования не поддерживается Вашим браузером");
            else tiDoc.designMode = (isGecko) ? "on" : "On";
            tiWin.focus();
            tiWin.document.execCommand("underline", null, "");
        }
        function template_setImage(url) {
            var isGecko = navigator.userAgent.toLowerCase().indexOf("gecko") != -1;
            var tiframe = (isGecko) ? document.getElementById("tframeId") : frames["tframeId"];
            var tiWin = (isGecko) ? tiframe.contentWindow : tiframe.window;
            var tiDoc = (isGecko) ? tiframe.contentDocument : tiframe.document;
            if (!tiDoc.designMode) alert("Визуальный режим редактирования не поддерживается Вашим браузером");
            else tiDoc.designMode = (isGecko) ? "on" : "On";
            tiWin.focus();
            tiWin.document.execCommand("InsertImage", null, url);
        }
    </script>
</head>
<body onload="templateScript(), __writeScript()">

    <div> HTML - шаблон
           
        <table style="width: 100%;" cellpadding="0" cellspacing="0">
            <tr>
                <td style="height:10px; width:10px; background-color:Silver;"></td>
                <td style="height:10px;background-color:Silver;"></td>
                <td style="height:10px; width:10px;background-color:Silver;"></td>
            </tr>
            
            <tr id="directionrow">
            <td style="height:24px; width:10px;background-color:Silver;"></td>
            <td id="directioncell">
                <input type="image" src="Images/FormatButtonImages/20_20/save.gif" />
                <input type="image" src="Images/FormatButtonImages/20_20/print.gif" />
                <input type="image" src="Images/FormatButtonImages/20_20/new.gif" />
                <input type="image" src="Images/FormatButtonImages/20_20/open.gif" />
                <input type="image" src="Images/FormatButtonImages/20_20/copy.gif" />
                <input type="image"  src="Images/FormatButtonImages/20_20/cut.gif" />
                <input type="image"  src="Images/FormatButtonImages/20_20/paste.gif" />
                <input type="image"  src="Images/FormatButtonImages/20_20/insertDate.gif" />
                <input type="image" src="Images/FormatButtonImages/20_20/undo.gif" />
                <input type="image" src="Images/FormatButtonImages/20_20/redo.gif"/>
                
                <input type="image" src="Images/FormatButtonImages/20_20/refresh.gif" />
                <input type="image" src="Images/FormatButtonImages/20_20/help.gif" />
            
            </td>
            <td style="height:24px; width:10px;background-color:Silver;"></td>
            </tr>
           
            <tr id="textrow">
                <td style="height:24px; width:10px;background-color:Silver;"></td>
                <td>
                    <input type="image"  src="Images/FormatButtonImages/20_20/pastetext.gif"/>
                    <input type="image"  src="Images/FormatButtonImages/20_20/bold.gif" onclick="template_setBold()" />
                    <input type="image" src="Images/FormatButtonImages/20_20/italic.gif" onclick="template_setItal()" />
                    <input type="image" src="Images/FormatButtonImages/20_20/under.gif" onclick="template_setUnder()" />
                    <input type="image" src="Images/FormatButtonImages/20_20/left.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/center.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/justifyfull.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/justifynone.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/right.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/paragraph.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/indent.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/outdent.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/bullist.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/fontcolor.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/lcase.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/ucase.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/link.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/rule.gif" />
                </td>
                <td  style="height:24px; width:10px;background-color:Silver;"></td>
            </tr>
            
            <tr id="tablesrow">
                <td style="height:24px; width:10px;background-color:Silver;"></td>
                <td>
                    <input type="image"  src="Images/FormatButtonImages/20_20/border_bottom.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/border_left.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/border_none.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/border_outside.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/border_right.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/border_top.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/box.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/row.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/delrow.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/imageeditor.gif" />
                </td>
                <td  style="height:24px; width:10px;background-color:Silver;"></td>
            </tr>
            
            <tr id="smilesrow">
                <td style="height:24px; width:10px;background-color:Silver;"></td>
                <td>
                    <input type="image" src="Images/SmileButtonImages/20_20/face1.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face2.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face3.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face4.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face5.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face6.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face7.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face8.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face9.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face10.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face11.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face12.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face13.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face14.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face15.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face16.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face17.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face18.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face19.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face20.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face21.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face22.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face23.gif" onclick="template_setImage(this.src);" />
                    <input type="image" src="Images/SmileButtonImages/20_20/face24.gif" onclick="template_setImage(this.src);" />
                </td>
                <td  style="height:24px; width:10px;background-color:Silver;"></td>
            </tr>

            <tr id="imagesrow">
                <td style="height:24px; width:10px;background-color:Silver;"></td>
                <td>
                    <input type="image"  src="Images/FormatButtonImages/20_20/image.gif" />
                    <input type="image"  src="Images/FormatButtonImages/20_20/eximage.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/resize.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/forward.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/backward.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/zoom_in.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/zoom_out.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/Actualsize.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/bestfit.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/imageeditor.gif" />
                </td>
                <td  style="height:24px; width:10px;background-color:Silver;"></td>
            </tr>
            
            <tr id="mediarow">
                <td style="height:24px; width:10px;background-color:Silver;"></td>
                <td>
                    <input type="image"  src="Images/FormatButtonImages/20_20/media.gif" />
                    <input type="image"  src="Images/FormatButtonImages/20_20/avi.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/swf.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/wav.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/au.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/Actualsize.gif" />
                    <input type="image" src="Images/FormatButtonImages/20_20/bestfit.gif" />
                </td>
                <td  style="height:24px; width:10px;background-color:Silver;"></td>
            </tr>
            
            <tr id="textfieldrow">
                <td style="height:50px; width:10px;background-color:Silver;"></td>
                <td id="framecell" style="height:50px;"></td>
                <td style="height:50px; width:10px;background-color:Silver;"></td>
            </tr>
           
            <tr>
                <td style="height:10px; width:10px;background-color:Silver;"></td>
                <td style="height:10px;background-color:Silver;"></td>
                <td style="height:10px; width:10px;background-color:Silver;"></td>
            </tr>
        </table>
        </div>
        <hr />
        
        <hr />
        
    <form id="form1" runat="server">

        <div> рабочий вариант
       
        <Invoteco:RichTextBox ID="RichTextBox1" runat="server" />
         
        </div>
    </form>
    </body>
</html>
